package net.dopan.pigframe.config.mybatis;

import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
import net.dopan.pigframe.core.bean.interceptor.DataScopeInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Package: net.dopan.pigframe.config.mybatis
 * @Title: MybatisPlusConfig
 * @Description: mybatis配置
 * @author: 刘宽
 * @date: 2018/10/10 11:20
 */
@Configuration
@MapperScan("net.dopan.pigframe.demo.mapper")
public class MybatisPlusConfig {
    /**
     * 分页插件
     *
     * @return PaginationInterceptor
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

    /**
     * 数据权限插件
     *
     * @return DataScopeInterceptor
     */
    @Bean
    public DataScopeInterceptor dataScopeInterceptor() {
        return new DataScopeInterceptor();
    }
}